<?php
use yii\widgets\Breadcrumbs;
use yii\helpers\Html;
use yii\grid\GridView;
use \yii\db\Query;
use yii\widgets\ActiveForm;
use app\modules\clinical\models\Patient;

$this->title = '基本信息搜索';
$this->params['breadcrumbs'][] = ['label' => '临床信息', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$this->registerJsFile('@web/js/search.js?v=1', ['depends' => 'app\assets\AppAsset']);

?>
<style type="text/css">
    .search-div > div > table {width: 2000px !important;}
</style>

<p>
    <?= Html::a('新建患者基本信息', ['/search/search/create-patient'], ['class' => 'btn btn-success']) ?>
    <?= Html::a('清空搜索', ['/search/search/patient'], ['class' => 'btn btn-primary']) ?>
    <?= Html::a('导出', ['/export/patient'], ['class' => 'btn btn-default']) ?>
</p>

<div class="search-div">

    <?= GridView::widget([
         'filterModel' => $searchModel,
         'dataProvider' => $dataProvider,
         'columns' => [

             [
                 'value' => function($model) {
                     return Html::a('<i class="fa fa-paper-plane"></i>', '/search/search/enter/?id='.$model->pk_id.'&type=patient');
                 },
                 'format' => 'html',
             ],
             'pt_id',
             'dna_id',
             'pt_name',
             [
                 'attribute' => 'pt_sex',
                 'options' => ['width' => '80px'],
                 'value' => function($model) {
                     return Patient::getParams('sex', $model->pt_sex);
                 },
                 'filter' => Patient::getParams('sex'),
             ],
             [
                 'attribute' => 'pt_birth',
                 'filterInputOptions' => ['type' => 'date', 'class' => 'form-control'],
             ],
             'pt_addr',
             'rel_phone1',
             'rel_phone2',
             'pt_hsp',
             'pt_intro',
             'crt_name',
             'crt_date',
         ],
     ]); ?>

</div>
      	